package com.example.easybuy.service.impl;

import com.example.easybuy.mapper.EasybuyUserAddressMapper;
import com.example.easybuy.pojo.EasybuyUserAddress;
import com.example.easybuy.service.EasybuyUserAddressService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 服务实现类
 * </p>
 *
 * @author 张子晨
 * @since 2021-03-12
 */
@Service
public class EasybuyUserAddressServiceImpl implements EasybuyUserAddressService {

    @Autowired
    EasybuyUserAddressMapper easybuyUserAddressMapper;

    @Override
    public List<EasybuyUserAddress> getAddressByUserId(Integer userId) {
        return easybuyUserAddressMapper.getAddressByUserId(userId);
    }

    @Override
    public List<EasybuyUserAddress> getAllAddressByUserId(Integer userId) {
        return easybuyUserAddressMapper.getAllAddressByUserId(userId);
    }

    @Override
    public EasybuyUserAddress getAddressbyAddressId(Integer addressId) {
        return easybuyUserAddressMapper.getAddressbyAddressId(addressId);
    }

    @Override
    public int addUserAddress(Map<String, Object> params) {
        return easybuyUserAddressMapper.addUserAddress(params);
    }


}
